package nahuel.games.carracer;

import android.graphics.Bitmap;
import android.graphics.Canvas;

public abstract class Calle {

	protected Bitmap imagen;
	protected int ancho;
	protected int alto;
	protected int xPosCalle;	//Posicion de la calle en la base izq de la imagen
	protected int xPosCalleFin;	//Posicion de la calle en la parte superior izq de la imagen
	
	public final static int X_RECTA = 84;
	public final static int X_DIAGONAL_I = 147;
	public final static int XS_DIAGONAL_I = 21;
	public final static int X_DIAGONAL_D = 21;
	public final static int XS_DIAGONAL_D = 147;
	public final static int X_ESQUINA = 84;
	
	protected Calle(Bitmap imagen, int xPosCalle, int xPosCalleFin){
		this.imagen = imagen;
		this.ancho = imagen.getWidth();
		this.alto = imagen.getHeight();
		this.xPosCalle = xPosCalle;
		this.xPosCalleFin = xPosCalleFin;
	}
	
	public abstract boolean enRuta(int posX, int posY);
    
	public void draw(Canvas canvas, int posx, int posy) {
		canvas.drawBitmap(imagen, posx, posy, null);
	}
	
	public int getAncho() {
		return ancho;
	}

	public int getAlto() {
		return alto;
	}
	
	public int getPosCalle() {
		return xPosCalle;
	}

	public int getPosCalleFin() {
		return xPosCalleFin;
	}
}
